import { Cascader } from 'antd'
import useAsyncOptions from '../../hooks/useAsyncOptions'
const { SHOW_CHILD } = Cascader

const MyCascader = ({ options, value, onChange, ...restItem }) => {
  const { asyncOptions } = useAsyncOptions(options)
  
  return (
    <Cascader
      options={asyncOptions}
      value={value}
      onChange={onChange}
      multiple
      allowClear
      showSearch
      maxTagCount="responsive"
      showCheckedStrategy={SHOW_CHILD}
      { ...restItem }
    />
  )
}

export default MyCascader
